ACKme
/
wiconnect-test-console
Test serial console demonstrating various API functions of WiConnect library.
tests/blocking/network/NetworkTests.h@25:c8ca04ebbb96, 2014-11-27 (annotated)
- Committer:
- dan_ackme
- Date:
- Thu Nov 27 10:26:58 2014 +0000
- Revision:
- 25:c8ca04ebbb96
- Parent:
- 12:3dd3a1be40c1
updated for latest wiconnect
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan_ackme | 12:3dd3a1be40c1 | 1 | /** |
dan_ackme | 12:3dd3a1be40c1 | 2 | * ACKme WiConnect Host Library is licensed under the BSD licence: |
dan_ackme | 12:3dd3a1be40c1 | 3 | * |
dan_ackme | 12:3dd3a1be40c1 | 4 | * Copyright (c)2014 ACKme Networks. |
dan_ackme | 12:3dd3a1be40c1 | 5 | * All rights reserved. |
dan_ackme | 12:3dd3a1be40c1 | 6 | * |
dan_ackme | 12:3dd3a1be40c1 | 7 | * Redistribution and use in source and binary forms, with or without modification, |
dan_ackme | 12:3dd3a1be40c1 | 8 | * are permitted provided that the following conditions are met: |
dan_ackme | 12:3dd3a1be40c1 | 9 | * |
dan_ackme | 12:3dd3a1be40c1 | 10 | * 1. Redistributions of source code must retain the above copyright notice, |
dan_ackme | 12:3dd3a1be40c1 | 11 | * this list of conditions and the following disclaimer. |
dan_ackme | 12:3dd3a1be40c1 | 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
dan_ackme | 12:3dd3a1be40c1 | 13 | * this list of conditions and the following disclaimer in the documentation |
dan_ackme | 12:3dd3a1be40c1 | 14 | * and/or other materials provided with the distribution. |
dan_ackme | 12:3dd3a1be40c1 | 15 | * 3. The name of the author may not be used to endorse or promote products |
dan_ackme | 12:3dd3a1be40c1 | 16 | * derived from this software without specific prior written permission. |
dan_ackme | 12:3dd3a1be40c1 | 17 | * |
dan_ackme | 12:3dd3a1be40c1 | 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS AND ANY EXPRESS OR IMPLIED |
dan_ackme | 12:3dd3a1be40c1 | 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
dan_ackme | 12:3dd3a1be40c1 | 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
dan_ackme | 12:3dd3a1be40c1 | 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
dan_ackme | 12:3dd3a1be40c1 | 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
dan_ackme | 12:3dd3a1be40c1 | 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
dan_ackme | 12:3dd3a1be40c1 | 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
dan_ackme | 12:3dd3a1be40c1 | 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
dan_ackme | 12:3dd3a1be40c1 | 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
dan_ackme | 12:3dd3a1be40c1 | 27 | * OF SUCH DAMAGE. |
dan_ackme | 0:836c9a6383e0 | 28 | */ |
dan_ackme | 0:836c9a6383e0 | 29 | #pragma once |
dan_ackme | 0:836c9a6383e0 | 30 | |
dan_ackme | 0:836c9a6383e0 | 31 | |
dan_ackme | 0:836c9a6383e0 | 32 | #define NETWORK_TEST_CMD_LIST \ |
dan_ackme | 0:836c9a6383e0 | 33 | ADD_HEADER("Network commands:"), \ |
dan_ackme | 0:836c9a6383e0 | 34 | ADD_CMD("setup", networkSetupWeb, "start/stop/check web setup", \ |
dan_ackme | 0:836c9a6383e0 | 35 | "Usage: setup <start/stop/status> [<ssid> [<password>]]\n" \ |
dan_ackme | 0:836c9a6383e0 | 36 | "Examples:\n" \ |
dan_ackme | 0:836c9a6383e0 | 37 | "> setup start MySSID password\n" \ |
dan_ackme | 0:836c9a6383e0 | 38 | "> setup check\n" \ |
dan_ackme | 0:836c9a6383e0 | 39 | "> setup stop"), \ |
dan_ackme | 0:836c9a6383e0 | 40 | ADD_CMD("join", networkJoin, "Join a network", \ |
dan_ackme | 0:836c9a6383e0 | 41 | "Usage: join [<ssid> [<password>]]"), \ |
dan_ackme | 0:836c9a6383e0 | 42 | ADD_CMD("leave", networkLeave, "Leave a network", \ |
dan_ackme | 0:836c9a6383e0 | 43 | "Usage: leave"), \ |
dan_ackme | 0:836c9a6383e0 | 44 | ADD_CMD("netstat", networkStats, "Get network information", \ |
dan_ackme | 0:836c9a6383e0 | 45 | "Usage: netstat"), \ |
dan_ackme | 0:836c9a6383e0 | 46 | ADD_CMD("scan", networkScan, "Return list of available networks", \ |
dan_ackme | 0:836c9a6383e0 | 47 | "Usage: scan [<channel list>/<all> [<ssid>]]\n" \ |
dan_ackme | 0:836c9a6383e0 | 48 | "Examples:\n" \ |
dan_ackme | 0:836c9a6383e0 | 49 | "> scan 1,6,11\n" \ |
dan_ackme | 0:836c9a6383e0 | 50 | "> scan all \"My Network's Name\""), \ |
dan_ackme | 0:836c9a6383e0 | 51 | ADD_CMD("ping", networkPing, "Ping a network", \ |
dan_ackme | 0:836c9a6383e0 | 52 | "Usage: ping [<host/IP address>]\n" \ |
dan_ackme | 0:836c9a6383e0 | 53 | "Examples:\n" \ |
dan_ackme | 0:836c9a6383e0 | 54 | "> ping // ping the gateway\n" \ |
dan_ackme | 0:836c9a6383e0 | 55 | "> ping www.ack.me"), \ |
dan_ackme | 0:836c9a6383e0 | 56 | ADD_CMD("lookup", networkLookup, "Resolve domain name to IP address", \ |
dan_ackme | 0:836c9a6383e0 | 57 | "Usage: lookup <domain>\n" \ |
dan_ackme | 0:836c9a6383e0 | 58 | "Examples:\n" \ |
dan_ackme | 0:836c9a6383e0 | 59 | "> lookup www.ack.me") |
dan_ackme | 0:836c9a6383e0 | 60 | |
dan_ackme | 0:836c9a6383e0 | 61 | |
dan_ackme | 0:836c9a6383e0 | 62 | WiconnectResult networkSetupWebCommand(int argc, char **argv); |
dan_ackme | 0:836c9a6383e0 | 63 | WiconnectResult networkJoinCommand(int argc, char **argv); |
dan_ackme | 0:836c9a6383e0 | 64 | WiconnectResult networkLeaveCommand(int argc, char **argv); |
dan_ackme | 0:836c9a6383e0 | 65 | WiconnectResult networkStatsCommand(int argc, char **argv); |
dan_ackme | 0:836c9a6383e0 | 66 | WiconnectResult networkScanCommand(int argc, char **argv); |
dan_ackme | 0:836c9a6383e0 | 67 | WiconnectResult networkPingCommand(int argc, char **argv); |
dan_ackme | 0:836c9a6383e0 | 68 | WiconnectResult networkLookupCommand(int argc, char **argv); |