Integrating the ublox LISA C200 modem

Fork of SprintUSBModemHTTPClientTest by Donatien Garnier

Committer:
sam_grove
Date:
Thu Sep 26 00:44:20 2013 -0500
Revision:
5:3f93dd1d4cb3
Exported program and replaced contents of the repo with the source
to build and debug using keil mdk. Libs NOT upto date are lwip, lwip-sys
and socket. these have newer versions under mbed_official but were starting
from a know working point

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sam_grove 5:3f93dd1d4cb3 1 /*
sam_grove 5:3f93dd1d4cb3 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
sam_grove 5:3f93dd1d4cb3 3 * All rights reserved.
sam_grove 5:3f93dd1d4cb3 4 *
sam_grove 5:3f93dd1d4cb3 5 * Redistribution and use in source and binary forms, with or without modification,
sam_grove 5:3f93dd1d4cb3 6 * are permitted provided that the following conditions are met:
sam_grove 5:3f93dd1d4cb3 7 *
sam_grove 5:3f93dd1d4cb3 8 * 1. Redistributions of source code must retain the above copyright notice,
sam_grove 5:3f93dd1d4cb3 9 * this list of conditions and the following disclaimer.
sam_grove 5:3f93dd1d4cb3 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
sam_grove 5:3f93dd1d4cb3 11 * this list of conditions and the following disclaimer in the documentation
sam_grove 5:3f93dd1d4cb3 12 * and/or other materials provided with the distribution.
sam_grove 5:3f93dd1d4cb3 13 * 3. The name of the author may not be used to endorse or promote products
sam_grove 5:3f93dd1d4cb3 14 * derived from this software without specific prior written permission.
sam_grove 5:3f93dd1d4cb3 15 *
sam_grove 5:3f93dd1d4cb3 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
sam_grove 5:3f93dd1d4cb3 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
sam_grove 5:3f93dd1d4cb3 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
sam_grove 5:3f93dd1d4cb3 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
sam_grove 5:3f93dd1d4cb3 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
sam_grove 5:3f93dd1d4cb3 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
sam_grove 5:3f93dd1d4cb3 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
sam_grove 5:3f93dd1d4cb3 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
sam_grove 5:3f93dd1d4cb3 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
sam_grove 5:3f93dd1d4cb3 25 * OF SUCH DAMAGE.
sam_grove 5:3f93dd1d4cb3 26 *
sam_grove 5:3f93dd1d4cb3 27 * This file is part of the lwIP TCP/IP stack.
sam_grove 5:3f93dd1d4cb3 28 *
sam_grove 5:3f93dd1d4cb3 29 * Author: Adam Dunkels <adam@sics.se>
sam_grove 5:3f93dd1d4cb3 30 *
sam_grove 5:3f93dd1d4cb3 31 */
sam_grove 5:3f93dd1d4cb3 32 #ifndef __LWIP_INET_H__
sam_grove 5:3f93dd1d4cb3 33 #define __LWIP_INET_H__
sam_grove 5:3f93dd1d4cb3 34
sam_grove 5:3f93dd1d4cb3 35 #include "lwip/opt.h"
sam_grove 5:3f93dd1d4cb3 36 #include "lwip/def.h"
sam_grove 5:3f93dd1d4cb3 37 #include "lwip/ip_addr.h"
sam_grove 5:3f93dd1d4cb3 38
sam_grove 5:3f93dd1d4cb3 39 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 40 extern "C" {
sam_grove 5:3f93dd1d4cb3 41 #endif
sam_grove 5:3f93dd1d4cb3 42
sam_grove 5:3f93dd1d4cb3 43 /** For compatibility with BSD code */
sam_grove 5:3f93dd1d4cb3 44 struct in_addr {
sam_grove 5:3f93dd1d4cb3 45 u32_t s_addr;
sam_grove 5:3f93dd1d4cb3 46 };
sam_grove 5:3f93dd1d4cb3 47
sam_grove 5:3f93dd1d4cb3 48 /** 255.255.255.255 */
sam_grove 5:3f93dd1d4cb3 49 #define INADDR_NONE IPADDR_NONE
sam_grove 5:3f93dd1d4cb3 50 /** 127.0.0.1 */
sam_grove 5:3f93dd1d4cb3 51 #define INADDR_LOOPBACK IPADDR_LOOPBACK
sam_grove 5:3f93dd1d4cb3 52 /** 0.0.0.0 */
sam_grove 5:3f93dd1d4cb3 53 #define INADDR_ANY IPADDR_ANY
sam_grove 5:3f93dd1d4cb3 54 /** 255.255.255.255 */
sam_grove 5:3f93dd1d4cb3 55 #define INADDR_BROADCAST IPADDR_BROADCAST
sam_grove 5:3f93dd1d4cb3 56
sam_grove 5:3f93dd1d4cb3 57 /* Definitions of the bits in an Internet address integer.
sam_grove 5:3f93dd1d4cb3 58
sam_grove 5:3f93dd1d4cb3 59 On subnets, host and network parts are found according to
sam_grove 5:3f93dd1d4cb3 60 the subnet mask, not these masks. */
sam_grove 5:3f93dd1d4cb3 61 #define IN_CLASSA(a) IP_CLASSA(a)
sam_grove 5:3f93dd1d4cb3 62 #define IN_CLASSA_NET IP_CLASSA_NET
sam_grove 5:3f93dd1d4cb3 63 #define IN_CLASSA_NSHIFT IP_CLASSA_NSHIFT
sam_grove 5:3f93dd1d4cb3 64 #define IN_CLASSA_HOST IP_CLASSA_HOST
sam_grove 5:3f93dd1d4cb3 65 #define IN_CLASSA_MAX IP_CLASSA_MAX
sam_grove 5:3f93dd1d4cb3 66
sam_grove 5:3f93dd1d4cb3 67 #define IN_CLASSB(b) IP_CLASSB(b)
sam_grove 5:3f93dd1d4cb3 68 #define IN_CLASSB_NET IP_CLASSB_NET
sam_grove 5:3f93dd1d4cb3 69 #define IN_CLASSB_NSHIFT IP_CLASSB_NSHIFT
sam_grove 5:3f93dd1d4cb3 70 #define IN_CLASSB_HOST IP_CLASSB_HOST
sam_grove 5:3f93dd1d4cb3 71 #define IN_CLASSB_MAX IP_CLASSB_MAX
sam_grove 5:3f93dd1d4cb3 72
sam_grove 5:3f93dd1d4cb3 73 #define IN_CLASSC(c) IP_CLASSC(c)
sam_grove 5:3f93dd1d4cb3 74 #define IN_CLASSC_NET IP_CLASSC_NET
sam_grove 5:3f93dd1d4cb3 75 #define IN_CLASSC_NSHIFT IP_CLASSC_NSHIFT
sam_grove 5:3f93dd1d4cb3 76 #define IN_CLASSC_HOST IP_CLASSC_HOST
sam_grove 5:3f93dd1d4cb3 77 #define IN_CLASSC_MAX IP_CLASSC_MAX
sam_grove 5:3f93dd1d4cb3 78
sam_grove 5:3f93dd1d4cb3 79 #define IN_CLASSD(d) IP_CLASSD(d)
sam_grove 5:3f93dd1d4cb3 80 #define IN_CLASSD_NET IP_CLASSD_NET /* These ones aren't really */
sam_grove 5:3f93dd1d4cb3 81 #define IN_CLASSD_NSHIFT IP_CLASSD_NSHIFT /* net and host fields, but */
sam_grove 5:3f93dd1d4cb3 82 #define IN_CLASSD_HOST IP_CLASSD_HOST /* routing needn't know. */
sam_grove 5:3f93dd1d4cb3 83 #define IN_CLASSD_MAX IP_CLASSD_MAX
sam_grove 5:3f93dd1d4cb3 84
sam_grove 5:3f93dd1d4cb3 85 #define IN_MULTICAST(a) IP_MULTICAST(a)
sam_grove 5:3f93dd1d4cb3 86
sam_grove 5:3f93dd1d4cb3 87 #define IN_EXPERIMENTAL(a) IP_EXPERIMENTAL(a)
sam_grove 5:3f93dd1d4cb3 88 #define IN_BADCLASS(a) IP_BADCLASS(a)
sam_grove 5:3f93dd1d4cb3 89
sam_grove 5:3f93dd1d4cb3 90 #define IN_LOOPBACKNET IP_LOOPBACKNET
sam_grove 5:3f93dd1d4cb3 91
sam_grove 5:3f93dd1d4cb3 92 #define inet_addr_from_ipaddr(target_inaddr, source_ipaddr) ((target_inaddr)->s_addr = ip4_addr_get_u32(source_ipaddr))
sam_grove 5:3f93dd1d4cb3 93 #define inet_addr_to_ipaddr(target_ipaddr, source_inaddr) (ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr))
sam_grove 5:3f93dd1d4cb3 94 /* ATTENTION: the next define only works because both s_addr and ip_addr_t are an u32_t effectively! */
sam_grove 5:3f93dd1d4cb3 95 #define inet_addr_to_ipaddr_p(target_ipaddr_p, source_inaddr) ((target_ipaddr_p) = (ip_addr_t*)&((source_inaddr)->s_addr))
sam_grove 5:3f93dd1d4cb3 96
sam_grove 5:3f93dd1d4cb3 97 /* directly map this to the lwip internal functions */
sam_grove 5:3f93dd1d4cb3 98 #define inet_addr(cp) ipaddr_addr(cp)
sam_grove 5:3f93dd1d4cb3 99 #define inet_aton(cp, addr) ipaddr_aton(cp, (ip_addr_t*)addr)
sam_grove 5:3f93dd1d4cb3 100 #define inet_ntoa(addr) ipaddr_ntoa((ip_addr_t*)&(addr))
sam_grove 5:3f93dd1d4cb3 101 #define inet_ntoa_r(addr, buf, buflen) ipaddr_ntoa_r((ip_addr_t*)&(addr), buf, buflen)
sam_grove 5:3f93dd1d4cb3 102
sam_grove 5:3f93dd1d4cb3 103 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 104 }
sam_grove 5:3f93dd1d4cb3 105 #endif
sam_grove 5:3f93dd1d4cb3 106
sam_grove 5:3f93dd1d4cb3 107 #endif /* __LWIP_INET_H__ */