Contains example code to connect the mbed LPC1768 or FRDM-K64F devices to the IBM Internet of Things Cloud service via ethernet.

Dependencies:   C12832 MQTT LM75B MMA7660

Dependents:   MFT_IoT_demo_USB400 IBM_RFID

Committer:
samdanbury
Date:
Wed Aug 20 12:45:14 2014 +0000
Revision:
6:37b6d0d56190
Code completely changed to improve the structure, flow and memory usage of the application

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samdanbury 6:37b6d0d56190 1 /**
samdanbury 6:37b6d0d56190 2 * @file
samdanbury 6:37b6d0d56190 3 * Error Management module
samdanbury 6:37b6d0d56190 4 *
samdanbury 6:37b6d0d56190 5 */
samdanbury 6:37b6d0d56190 6
samdanbury 6:37b6d0d56190 7 /*
samdanbury 6:37b6d0d56190 8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
samdanbury 6:37b6d0d56190 9 * All rights reserved.
samdanbury 6:37b6d0d56190 10 *
samdanbury 6:37b6d0d56190 11 * Redistribution and use in source and binary forms, with or without modification,
samdanbury 6:37b6d0d56190 12 * are permitted provided that the following conditions are met:
samdanbury 6:37b6d0d56190 13 *
samdanbury 6:37b6d0d56190 14 * 1. Redistributions of source code must retain the above copyright notice,
samdanbury 6:37b6d0d56190 15 * this list of conditions and the following disclaimer.
samdanbury 6:37b6d0d56190 16 * 2. Redistributions in binary form must reproduce the above copyright notice,
samdanbury 6:37b6d0d56190 17 * this list of conditions and the following disclaimer in the documentation
samdanbury 6:37b6d0d56190 18 * and/or other materials provided with the distribution.
samdanbury 6:37b6d0d56190 19 * 3. The name of the author may not be used to endorse or promote products
samdanbury 6:37b6d0d56190 20 * derived from this software without specific prior written permission.
samdanbury 6:37b6d0d56190 21 *
samdanbury 6:37b6d0d56190 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
samdanbury 6:37b6d0d56190 23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
samdanbury 6:37b6d0d56190 24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
samdanbury 6:37b6d0d56190 25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
samdanbury 6:37b6d0d56190 26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
samdanbury 6:37b6d0d56190 27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
samdanbury 6:37b6d0d56190 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
samdanbury 6:37b6d0d56190 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
samdanbury 6:37b6d0d56190 30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
samdanbury 6:37b6d0d56190 31 * OF SUCH DAMAGE.
samdanbury 6:37b6d0d56190 32 *
samdanbury 6:37b6d0d56190 33 * This file is part of the lwIP TCP/IP stack.
samdanbury 6:37b6d0d56190 34 *
samdanbury 6:37b6d0d56190 35 * Author: Adam Dunkels <adam@sics.se>
samdanbury 6:37b6d0d56190 36 *
samdanbury 6:37b6d0d56190 37 */
samdanbury 6:37b6d0d56190 38
samdanbury 6:37b6d0d56190 39 #include "lwip/err.h"
samdanbury 6:37b6d0d56190 40
samdanbury 6:37b6d0d56190 41 #ifdef LWIP_DEBUG
samdanbury 6:37b6d0d56190 42
samdanbury 6:37b6d0d56190 43 static const char *err_strerr[] = {
samdanbury 6:37b6d0d56190 44 "Ok.", /* ERR_OK 0 */
samdanbury 6:37b6d0d56190 45 "Out of memory error.", /* ERR_MEM -1 */
samdanbury 6:37b6d0d56190 46 "Buffer error.", /* ERR_BUF -2 */
samdanbury 6:37b6d0d56190 47 "Timeout.", /* ERR_TIMEOUT -3 */
samdanbury 6:37b6d0d56190 48 "Routing problem.", /* ERR_RTE -4 */
samdanbury 6:37b6d0d56190 49 "Operation in progress.", /* ERR_INPROGRESS -5 */
samdanbury 6:37b6d0d56190 50 "Illegal value.", /* ERR_VAL -6 */
samdanbury 6:37b6d0d56190 51 "Operation would block.", /* ERR_WOULDBLOCK -7 */
samdanbury 6:37b6d0d56190 52 "Address in use.", /* ERR_USE -8 */
samdanbury 6:37b6d0d56190 53 "Already connected.", /* ERR_ISCONN -9 */
samdanbury 6:37b6d0d56190 54 "Connection aborted.", /* ERR_ABRT -10 */
samdanbury 6:37b6d0d56190 55 "Connection reset.", /* ERR_RST -11 */
samdanbury 6:37b6d0d56190 56 "Connection closed.", /* ERR_CLSD -12 */
samdanbury 6:37b6d0d56190 57 "Not connected.", /* ERR_CONN -13 */
samdanbury 6:37b6d0d56190 58 "Illegal argument.", /* ERR_ARG -14 */
samdanbury 6:37b6d0d56190 59 "Low-level netif error.", /* ERR_IF -15 */
samdanbury 6:37b6d0d56190 60 };
samdanbury 6:37b6d0d56190 61
samdanbury 6:37b6d0d56190 62 /**
samdanbury 6:37b6d0d56190 63 * Convert an lwip internal error to a string representation.
samdanbury 6:37b6d0d56190 64 *
samdanbury 6:37b6d0d56190 65 * @param err an lwip internal err_t
samdanbury 6:37b6d0d56190 66 * @return a string representation for err
samdanbury 6:37b6d0d56190 67 */
samdanbury 6:37b6d0d56190 68 const char *
samdanbury 6:37b6d0d56190 69 lwip_strerr(err_t err)
samdanbury 6:37b6d0d56190 70 {
samdanbury 6:37b6d0d56190 71 return err_strerr[-err];
samdanbury 6:37b6d0d56190 72
samdanbury 6:37b6d0d56190 73 }
samdanbury 6:37b6d0d56190 74
samdanbury 6:37b6d0d56190 75 #endif /* LWIP_DEBUG */