Example application demonstrating the TCP server API of the WiConnect Host Library

Dependencies:   WiConnect mbed

Committer:
dan_ackme
Date:
Thu Nov 27 10:27:22 2014 +0000
Revision:
5:1c7bb44de59f
Parent:
0:19d3a6600a5a
Child:
3:dc3401fb1f99
updated for latest wiconnect

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dan_ackme 0:19d3a6600a5a 1 /**
dan_ackme 0:19d3a6600a5a 2 * ACKme WiConnect Host Library is licensed under the BSD licence:
dan_ackme 0:19d3a6600a5a 3 *
dan_ackme 0:19d3a6600a5a 4 * Copyright (c)2014 ACKme Networks.
dan_ackme 0:19d3a6600a5a 5 * All rights reserved.
dan_ackme 0:19d3a6600a5a 6 *
dan_ackme 0:19d3a6600a5a 7 * Redistribution and use in source and binary forms, with or without modification,
dan_ackme 0:19d3a6600a5a 8 * are permitted provided that the following conditions are met:
dan_ackme 0:19d3a6600a5a 9 *
dan_ackme 0:19d3a6600a5a 10 * 1. Redistributions of source code must retain the above copyright notice,
dan_ackme 0:19d3a6600a5a 11 * this list of conditions and the following disclaimer.
dan_ackme 0:19d3a6600a5a 12 * 2. Redistributions in binary form must reproduce the above copyright notice,
dan_ackme 0:19d3a6600a5a 13 * this list of conditions and the following disclaimer in the documentation
dan_ackme 0:19d3a6600a5a 14 * and/or other materials provided with the distribution.
dan_ackme 0:19d3a6600a5a 15 * 3. The name of the author may not be used to endorse or promote products
dan_ackme 0:19d3a6600a5a 16 * derived from this software without specific prior written permission.
dan_ackme 0:19d3a6600a5a 17 *
dan_ackme 0:19d3a6600a5a 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS AND ANY EXPRESS OR IMPLIED
dan_ackme 0:19d3a6600a5a 19 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dan_ackme 0:19d3a6600a5a 20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
dan_ackme 0:19d3a6600a5a 21 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
dan_ackme 0:19d3a6600a5a 22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
dan_ackme 0:19d3a6600a5a 23 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dan_ackme 0:19d3a6600a5a 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
dan_ackme 0:19d3a6600a5a 25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
dan_ackme 0:19d3a6600a5a 26 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
dan_ackme 0:19d3a6600a5a 27 * OF SUCH DAMAGE.
dan_ackme 0:19d3a6600a5a 28 */
dan_ackme 0:19d3a6600a5a 29 #pragma once
dan_ackme 0:19d3a6600a5a 30
dan_ackme 0:19d3a6600a5a 31
dan_ackme 0:19d3a6600a5a 32 // The BAUD rate your PC/MAC/Linux terminal uses with the eval board
dan_ackme 0:19d3a6600a5a 33 #define CONSOLE_BAUD 115200
dan_ackme 0:19d3a6600a5a 34
dan_ackme 0:19d3a6600a5a 35
dan_ackme 0:19d3a6600a5a 36 // Uncomment this to enable WiConnect serial interface hardware flow control
dan_ackme 0:19d3a6600a5a 37 // NOTE: your platform must support the serial flow control api functions
dan_ackme 0:19d3a6600a5a 38 //#define ENABLE_FLOW_CONTROL
dan_ackme 0:19d3a6600a5a 39
dan_ackme 0:19d3a6600a5a 40
dan_ackme 0:19d3a6600a5a 41 #define WICONNECT_INTERNAL_BUFFER_SIZE (4*1024)
dan_ackme 0:19d3a6600a5a 42 #define WICONNECT_SERIAL_RX_BUFFER_SIZE (4*1024)
dan_ackme 0:19d3a6600a5a 43
dan_ackme 0:19d3a6600a5a 44 #define DEFAULT_CMD_GETCHAR_TIMEOUT 250
dan_ackme 0:19d3a6600a5a 45 #define DEFAULT_COMMAND_LINE_LENGTH_MAX 128
dan_ackme 0:19d3a6600a5a 46 #define DEFAULT_COMMAND_MAX_HISTORY 16
dan_ackme 0:19d3a6600a5a 47 #define DEFAULT_CMD_PROMPT_STR "> "
dan_ackme 0:19d3a6600a5a 48 #define DEFAULT_COMMAND_MAX_ARGV 16
dan_ackme 0:19d3a6600a5a 49
dan_ackme 0:19d3a6600a5a 50 #define TEST_NONBLOCKING_API false
dan_ackme 0:19d3a6600a5a 51 #define TEST_BUFFER_LENGTH 4*1024
dan_ackme 0:19d3a6600a5a 52
dan_ackme 0:19d3a6600a5a 53
dan_ackme 0:19d3a6600a5a 54 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dan_ackme 0:19d3a6600a5a 55 // Seabass Target Configuration
dan_ackme 0:19d3a6600a5a 56 #ifdef TARGET_SEABASS
dan_ackme 0:19d3a6600a5a 57
dan_ackme 0:19d3a6600a5a 58 #define WICONNECT_TX_PIN PA_9
dan_ackme 0:19d3a6600a5a 59 #define WICONNECT_RX_PIN PA_10
dan_ackme 0:19d3a6600a5a 60 #define WICONNECT_RESET_PIN PB_0
dan_ackme 0:19d3a6600a5a 61 #define WICONNECT_WAKE_PIN NC
dan_ackme 0:19d3a6600a5a 62
dan_ackme 0:19d3a6600a5a 63 #ifdef ENABLE_FLOW_CONTROL
dan_ackme 0:19d3a6600a5a 64 #define WICONNECT_CTS_PIN PA_11
dan_ackme 0:19d3a6600a5a 65 #define WICONNECT_RTS_PIN PA_12
dan_ackme 0:19d3a6600a5a 66 #else
dan_ackme 0:19d3a6600a5a 67 #define WICONNECT_CTS_PIN NC
dan_ackme 0:19d3a6600a5a 68 #define WICONNECT_RTS_PIN NC
dan_ackme 0:19d3a6600a5a 69 #endif
dan_ackme 0:19d3a6600a5a 70
dan_ackme 0:19d3a6600a5a 71 #endif
dan_ackme 0:19d3a6600a5a 72
dan_ackme 0:19d3a6600a5a 73
dan_ackme 0:19d3a6600a5a 74 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dan_ackme 0:19d3a6600a5a 75 // Nucleo F401RE Target Configuration
dan_ackme 0:19d3a6600a5a 76 #ifdef TARGET_NUCLEO_F401RE
dan_ackme 0:19d3a6600a5a 77
dan_ackme 0:19d3a6600a5a 78 #define WICONNECT_TX_PIN PA_9
dan_ackme 0:19d3a6600a5a 79 #define WICONNECT_RX_PIN PA_10
dan_ackme 0:19d3a6600a5a 80 #define WICONNECT_RESET_PIN PC_7
dan_ackme 0:19d3a6600a5a 81 #define WICONNECT_WAKE_PIN NC
dan_ackme 0:19d3a6600a5a 82
dan_ackme 0:19d3a6600a5a 83 #ifdef ENABLE_FLOW_CONTROL
dan_ackme 0:19d3a6600a5a 84 #define WICONNECT_CTS_PIN PA_11
dan_ackme 0:19d3a6600a5a 85 #define WICONNECT_RTS_PIN PA_12
dan_ackme 0:19d3a6600a5a 86 #else
dan_ackme 0:19d3a6600a5a 87 #define WICONNECT_CTS_PIN NC
dan_ackme 0:19d3a6600a5a 88 #define WICONNECT_RTS_PIN NC
dan_ackme 0:19d3a6600a5a 89 #endif
dan_ackme 0:19d3a6600a5a 90
dan_ackme 0:19d3a6600a5a 91 #endif
dan_ackme 0:19d3a6600a5a 92
dan_ackme 0:19d3a6600a5a 93