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_MEM_H__
sam_grove 5:3f93dd1d4cb3 33 #define __LWIP_MEM_H__
sam_grove 5:3f93dd1d4cb3 34
sam_grove 5:3f93dd1d4cb3 35 #include "lwip/opt.h"
sam_grove 5:3f93dd1d4cb3 36
sam_grove 5:3f93dd1d4cb3 37 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 38 extern "C" {
sam_grove 5:3f93dd1d4cb3 39 #endif
sam_grove 5:3f93dd1d4cb3 40
sam_grove 5:3f93dd1d4cb3 41 #if MEM_LIBC_MALLOC
sam_grove 5:3f93dd1d4cb3 42
sam_grove 5:3f93dd1d4cb3 43 #include <stddef.h> /* for size_t */
sam_grove 5:3f93dd1d4cb3 44
sam_grove 5:3f93dd1d4cb3 45 typedef size_t mem_size_t;
sam_grove 5:3f93dd1d4cb3 46
sam_grove 5:3f93dd1d4cb3 47 /* aliases for C library malloc() */
sam_grove 5:3f93dd1d4cb3 48 #define mem_init()
sam_grove 5:3f93dd1d4cb3 49 /* in case C library malloc() needs extra protection,
sam_grove 5:3f93dd1d4cb3 50 * allow these defines to be overridden.
sam_grove 5:3f93dd1d4cb3 51 */
sam_grove 5:3f93dd1d4cb3 52 #ifndef mem_free
sam_grove 5:3f93dd1d4cb3 53 #define mem_free free
sam_grove 5:3f93dd1d4cb3 54 #endif
sam_grove 5:3f93dd1d4cb3 55 #ifndef mem_malloc
sam_grove 5:3f93dd1d4cb3 56 #define mem_malloc malloc
sam_grove 5:3f93dd1d4cb3 57 #endif
sam_grove 5:3f93dd1d4cb3 58 #ifndef mem_calloc
sam_grove 5:3f93dd1d4cb3 59 #define mem_calloc calloc
sam_grove 5:3f93dd1d4cb3 60 #endif
sam_grove 5:3f93dd1d4cb3 61 /* Since there is no C library allocation function to shrink memory without
sam_grove 5:3f93dd1d4cb3 62 moving it, define this to nothing. */
sam_grove 5:3f93dd1d4cb3 63 #ifndef mem_trim
sam_grove 5:3f93dd1d4cb3 64 #define mem_trim(mem, size) (mem)
sam_grove 5:3f93dd1d4cb3 65 #endif
sam_grove 5:3f93dd1d4cb3 66 #else /* MEM_LIBC_MALLOC */
sam_grove 5:3f93dd1d4cb3 67
sam_grove 5:3f93dd1d4cb3 68 /* MEM_SIZE would have to be aligned, but using 64000 here instead of
sam_grove 5:3f93dd1d4cb3 69 * 65535 leaves some room for alignment...
sam_grove 5:3f93dd1d4cb3 70 */
sam_grove 5:3f93dd1d4cb3 71 #if MEM_SIZE > 64000L
sam_grove 5:3f93dd1d4cb3 72 typedef u32_t mem_size_t;
sam_grove 5:3f93dd1d4cb3 73 #define MEM_SIZE_F U32_F
sam_grove 5:3f93dd1d4cb3 74 #else
sam_grove 5:3f93dd1d4cb3 75 typedef u16_t mem_size_t;
sam_grove 5:3f93dd1d4cb3 76 #define MEM_SIZE_F U16_F
sam_grove 5:3f93dd1d4cb3 77 #endif /* MEM_SIZE > 64000 */
sam_grove 5:3f93dd1d4cb3 78
sam_grove 5:3f93dd1d4cb3 79 #if MEM_USE_POOLS
sam_grove 5:3f93dd1d4cb3 80 /** mem_init is not used when using pools instead of a heap */
sam_grove 5:3f93dd1d4cb3 81 #define mem_init()
sam_grove 5:3f93dd1d4cb3 82 /** mem_trim is not used when using pools instead of a heap:
sam_grove 5:3f93dd1d4cb3 83 we can't free part of a pool element and don't want to copy the rest */
sam_grove 5:3f93dd1d4cb3 84 #define mem_trim(mem, size) (mem)
sam_grove 5:3f93dd1d4cb3 85 #else /* MEM_USE_POOLS */
sam_grove 5:3f93dd1d4cb3 86 /* lwIP alternative malloc */
sam_grove 5:3f93dd1d4cb3 87 void mem_init(void);
sam_grove 5:3f93dd1d4cb3 88 void *mem_trim(void *mem, mem_size_t size);
sam_grove 5:3f93dd1d4cb3 89 #endif /* MEM_USE_POOLS */
sam_grove 5:3f93dd1d4cb3 90 void *mem_malloc(mem_size_t size);
sam_grove 5:3f93dd1d4cb3 91 void *mem_calloc(mem_size_t count, mem_size_t size);
sam_grove 5:3f93dd1d4cb3 92 void mem_free(void *mem);
sam_grove 5:3f93dd1d4cb3 93 #endif /* MEM_LIBC_MALLOC */
sam_grove 5:3f93dd1d4cb3 94
sam_grove 5:3f93dd1d4cb3 95 /** Calculate memory size for an aligned buffer - returns the next highest
sam_grove 5:3f93dd1d4cb3 96 * multiple of MEM_ALIGNMENT (e.g. LWIP_MEM_ALIGN_SIZE(3) and
sam_grove 5:3f93dd1d4cb3 97 * LWIP_MEM_ALIGN_SIZE(4) will both yield 4 for MEM_ALIGNMENT == 4).
sam_grove 5:3f93dd1d4cb3 98 */
sam_grove 5:3f93dd1d4cb3 99 #ifndef LWIP_MEM_ALIGN_SIZE
sam_grove 5:3f93dd1d4cb3 100 #define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1))
sam_grove 5:3f93dd1d4cb3 101 #endif
sam_grove 5:3f93dd1d4cb3 102
sam_grove 5:3f93dd1d4cb3 103 /** Calculate safe memory size for an aligned buffer when using an unaligned
sam_grove 5:3f93dd1d4cb3 104 * type as storage. This includes a safety-margin on (MEM_ALIGNMENT - 1) at the
sam_grove 5:3f93dd1d4cb3 105 * start (e.g. if buffer is u8_t[] and actual data will be u32_t*)
sam_grove 5:3f93dd1d4cb3 106 */
sam_grove 5:3f93dd1d4cb3 107 #ifndef LWIP_MEM_ALIGN_BUFFER
sam_grove 5:3f93dd1d4cb3 108 #define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1))
sam_grove 5:3f93dd1d4cb3 109 #endif
sam_grove 5:3f93dd1d4cb3 110
sam_grove 5:3f93dd1d4cb3 111 /** Align a memory pointer to the alignment defined by MEM_ALIGNMENT
sam_grove 5:3f93dd1d4cb3 112 * so that ADDR % MEM_ALIGNMENT == 0
sam_grove 5:3f93dd1d4cb3 113 */
sam_grove 5:3f93dd1d4cb3 114 #ifndef LWIP_MEM_ALIGN
sam_grove 5:3f93dd1d4cb3 115 #define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1)))
sam_grove 5:3f93dd1d4cb3 116 #endif
sam_grove 5:3f93dd1d4cb3 117
sam_grove 5:3f93dd1d4cb3 118 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 119 }
sam_grove 5:3f93dd1d4cb3 120 #endif
sam_grove 5:3f93dd1d4cb3 121
sam_grove 5:3f93dd1d4cb3 122 #endif /* __LWIP_MEM_H__ */