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
sam_grove 5:3f93dd1d4cb3 30 /*
sam_grove 5:3f93dd1d4cb3 31 * This is the interface to the platform specific serial IO module
sam_grove 5:3f93dd1d4cb3 32 * It needs to be implemented by those platforms which need SLIP or PPP
sam_grove 5:3f93dd1d4cb3 33 */
sam_grove 5:3f93dd1d4cb3 34
sam_grove 5:3f93dd1d4cb3 35 #ifndef __SIO_H__
sam_grove 5:3f93dd1d4cb3 36 #define __SIO_H__
sam_grove 5:3f93dd1d4cb3 37
sam_grove 5:3f93dd1d4cb3 38 #include "lwip/arch.h"
sam_grove 5:3f93dd1d4cb3 39
sam_grove 5:3f93dd1d4cb3 40 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 41 extern "C" {
sam_grove 5:3f93dd1d4cb3 42 #endif
sam_grove 5:3f93dd1d4cb3 43
sam_grove 5:3f93dd1d4cb3 44 /* If you want to define sio_fd_t elsewhere or differently,
sam_grove 5:3f93dd1d4cb3 45 define this in your cc.h file. */
sam_grove 5:3f93dd1d4cb3 46 #ifndef __sio_fd_t_defined
sam_grove 5:3f93dd1d4cb3 47 typedef void * sio_fd_t;
sam_grove 5:3f93dd1d4cb3 48 #endif
sam_grove 5:3f93dd1d4cb3 49
sam_grove 5:3f93dd1d4cb3 50 /* The following functions can be defined to something else in your cc.h file
sam_grove 5:3f93dd1d4cb3 51 or be implemented in your custom sio.c file. */
sam_grove 5:3f93dd1d4cb3 52
sam_grove 5:3f93dd1d4cb3 53 #ifndef sio_open
sam_grove 5:3f93dd1d4cb3 54 /**
sam_grove 5:3f93dd1d4cb3 55 * Opens a serial device for communication.
sam_grove 5:3f93dd1d4cb3 56 *
sam_grove 5:3f93dd1d4cb3 57 * @param devnum device number
sam_grove 5:3f93dd1d4cb3 58 * @return handle to serial device if successful, NULL otherwise
sam_grove 5:3f93dd1d4cb3 59 */
sam_grove 5:3f93dd1d4cb3 60 sio_fd_t sio_open(u8_t devnum);
sam_grove 5:3f93dd1d4cb3 61 #endif
sam_grove 5:3f93dd1d4cb3 62
sam_grove 5:3f93dd1d4cb3 63 #ifndef sio_send
sam_grove 5:3f93dd1d4cb3 64 /**
sam_grove 5:3f93dd1d4cb3 65 * Sends a single character to the serial device.
sam_grove 5:3f93dd1d4cb3 66 *
sam_grove 5:3f93dd1d4cb3 67 * @param c character to send
sam_grove 5:3f93dd1d4cb3 68 * @param fd serial device handle
sam_grove 5:3f93dd1d4cb3 69 *
sam_grove 5:3f93dd1d4cb3 70 * @note This function will block until the character can be sent.
sam_grove 5:3f93dd1d4cb3 71 */
sam_grove 5:3f93dd1d4cb3 72 void sio_send(u8_t c, sio_fd_t fd);
sam_grove 5:3f93dd1d4cb3 73 #endif
sam_grove 5:3f93dd1d4cb3 74
sam_grove 5:3f93dd1d4cb3 75 #ifndef sio_recv
sam_grove 5:3f93dd1d4cb3 76 /**
sam_grove 5:3f93dd1d4cb3 77 * Receives a single character from the serial device.
sam_grove 5:3f93dd1d4cb3 78 *
sam_grove 5:3f93dd1d4cb3 79 * @param fd serial device handle
sam_grove 5:3f93dd1d4cb3 80 *
sam_grove 5:3f93dd1d4cb3 81 * @note This function will block until a character is received.
sam_grove 5:3f93dd1d4cb3 82 */
sam_grove 5:3f93dd1d4cb3 83 u8_t sio_recv(sio_fd_t fd);
sam_grove 5:3f93dd1d4cb3 84 #endif
sam_grove 5:3f93dd1d4cb3 85
sam_grove 5:3f93dd1d4cb3 86 #ifndef sio_read
sam_grove 5:3f93dd1d4cb3 87 /**
sam_grove 5:3f93dd1d4cb3 88 * Reads from the serial device.
sam_grove 5:3f93dd1d4cb3 89 *
sam_grove 5:3f93dd1d4cb3 90 * @param fd serial device handle
sam_grove 5:3f93dd1d4cb3 91 * @param data pointer to data buffer for receiving
sam_grove 5:3f93dd1d4cb3 92 * @param len maximum length (in bytes) of data to receive
sam_grove 5:3f93dd1d4cb3 93 * @return number of bytes actually received - may be 0 if aborted by sio_read_abort
sam_grove 5:3f93dd1d4cb3 94 *
sam_grove 5:3f93dd1d4cb3 95 * @note This function will block until data can be received. The blocking
sam_grove 5:3f93dd1d4cb3 96 * can be cancelled by calling sio_read_abort().
sam_grove 5:3f93dd1d4cb3 97 */
sam_grove 5:3f93dd1d4cb3 98 u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len);
sam_grove 5:3f93dd1d4cb3 99 #endif
sam_grove 5:3f93dd1d4cb3 100
sam_grove 5:3f93dd1d4cb3 101 #ifndef sio_tryread
sam_grove 5:3f93dd1d4cb3 102 /**
sam_grove 5:3f93dd1d4cb3 103 * Tries to read from the serial device. Same as sio_read but returns
sam_grove 5:3f93dd1d4cb3 104 * immediately if no data is available and never blocks.
sam_grove 5:3f93dd1d4cb3 105 *
sam_grove 5:3f93dd1d4cb3 106 * @param fd serial device handle
sam_grove 5:3f93dd1d4cb3 107 * @param data pointer to data buffer for receiving
sam_grove 5:3f93dd1d4cb3 108 * @param len maximum length (in bytes) of data to receive
sam_grove 5:3f93dd1d4cb3 109 * @return number of bytes actually received
sam_grove 5:3f93dd1d4cb3 110 */
sam_grove 5:3f93dd1d4cb3 111 u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len);
sam_grove 5:3f93dd1d4cb3 112 #endif
sam_grove 5:3f93dd1d4cb3 113
sam_grove 5:3f93dd1d4cb3 114 #ifndef sio_write
sam_grove 5:3f93dd1d4cb3 115 /**
sam_grove 5:3f93dd1d4cb3 116 * Writes to the serial device.
sam_grove 5:3f93dd1d4cb3 117 *
sam_grove 5:3f93dd1d4cb3 118 * @param fd serial device handle
sam_grove 5:3f93dd1d4cb3 119 * @param data pointer to data to send
sam_grove 5:3f93dd1d4cb3 120 * @param len length (in bytes) of data to send
sam_grove 5:3f93dd1d4cb3 121 * @return number of bytes actually sent
sam_grove 5:3f93dd1d4cb3 122 *
sam_grove 5:3f93dd1d4cb3 123 * @note This function will block until all data can be sent.
sam_grove 5:3f93dd1d4cb3 124 */
sam_grove 5:3f93dd1d4cb3 125 u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len);
sam_grove 5:3f93dd1d4cb3 126 #endif
sam_grove 5:3f93dd1d4cb3 127
sam_grove 5:3f93dd1d4cb3 128 #ifndef sio_read_abort
sam_grove 5:3f93dd1d4cb3 129 /**
sam_grove 5:3f93dd1d4cb3 130 * Aborts a blocking sio_read() call.
sam_grove 5:3f93dd1d4cb3 131 *
sam_grove 5:3f93dd1d4cb3 132 * @param fd serial device handle
sam_grove 5:3f93dd1d4cb3 133 */
sam_grove 5:3f93dd1d4cb3 134 void sio_read_abort(sio_fd_t fd);
sam_grove 5:3f93dd1d4cb3 135 #endif
sam_grove 5:3f93dd1d4cb3 136
sam_grove 5:3f93dd1d4cb3 137 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 138 }
sam_grove 5:3f93dd1d4cb3 139 #endif
sam_grove 5:3f93dd1d4cb3 140
sam_grove 5:3f93dd1d4cb3 141 #endif /* __SIO_H__ */