Netservices modded to read fragmented HTTP respsonse/payload from special purpose server - 180 bytes only

Committer:
RodColeman
Date:
Thu Sep 08 10:48:09 2011 +0000
Revision:
0:850eacf3e945
revised fixed length to 178 bytes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RodColeman 0:850eacf3e945 1 /*
RodColeman 0:850eacf3e945 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
RodColeman 0:850eacf3e945 3 * All rights reserved.
RodColeman 0:850eacf3e945 4 *
RodColeman 0:850eacf3e945 5 * Redistribution and use in source and binary forms, with or without modification,
RodColeman 0:850eacf3e945 6 * are permitted provided that the following conditions are met:
RodColeman 0:850eacf3e945 7 *
RodColeman 0:850eacf3e945 8 * 1. Redistributions of source code must retain the above copyright notice,
RodColeman 0:850eacf3e945 9 * this list of conditions and the following disclaimer.
RodColeman 0:850eacf3e945 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
RodColeman 0:850eacf3e945 11 * this list of conditions and the following disclaimer in the documentation
RodColeman 0:850eacf3e945 12 * and/or other materials provided with the distribution.
RodColeman 0:850eacf3e945 13 * 3. The name of the author may not be used to endorse or promote products
RodColeman 0:850eacf3e945 14 * derived from this software without specific prior written permission.
RodColeman 0:850eacf3e945 15 *
RodColeman 0:850eacf3e945 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
RodColeman 0:850eacf3e945 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
RodColeman 0:850eacf3e945 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
RodColeman 0:850eacf3e945 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
RodColeman 0:850eacf3e945 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
RodColeman 0:850eacf3e945 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
RodColeman 0:850eacf3e945 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
RodColeman 0:850eacf3e945 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
RodColeman 0:850eacf3e945 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
RodColeman 0:850eacf3e945 25 * OF SUCH DAMAGE.
RodColeman 0:850eacf3e945 26 *
RodColeman 0:850eacf3e945 27 * This file is part of the lwIP TCP/IP stack.
RodColeman 0:850eacf3e945 28 */
RodColeman 0:850eacf3e945 29
RodColeman 0:850eacf3e945 30 /*
RodColeman 0:850eacf3e945 31 * This is the interface to the platform specific serial IO module
RodColeman 0:850eacf3e945 32 * It needs to be implemented by those platforms which need SLIP or PPP
RodColeman 0:850eacf3e945 33 */
RodColeman 0:850eacf3e945 34
RodColeman 0:850eacf3e945 35 #ifndef __SIO_H__
RodColeman 0:850eacf3e945 36 #define __SIO_H__
RodColeman 0:850eacf3e945 37
RodColeman 0:850eacf3e945 38 #include "lwip/arch.h"
RodColeman 0:850eacf3e945 39
RodColeman 0:850eacf3e945 40 #ifdef __cplusplus
RodColeman 0:850eacf3e945 41 extern "C" {
RodColeman 0:850eacf3e945 42 #endif
RodColeman 0:850eacf3e945 43
RodColeman 0:850eacf3e945 44 /* If you want to define sio_fd_t elsewhere or differently,
RodColeman 0:850eacf3e945 45 define this in your cc.h file. */
RodColeman 0:850eacf3e945 46 #ifndef __sio_fd_t_defined
RodColeman 0:850eacf3e945 47 typedef void * sio_fd_t;
RodColeman 0:850eacf3e945 48 #endif
RodColeman 0:850eacf3e945 49
RodColeman 0:850eacf3e945 50 /* The following functions can be defined to something else in your cc.h file
RodColeman 0:850eacf3e945 51 or be implemented in your custom sio.c file. */
RodColeman 0:850eacf3e945 52
RodColeman 0:850eacf3e945 53 #ifndef sio_open
RodColeman 0:850eacf3e945 54 /**
RodColeman 0:850eacf3e945 55 * Opens a serial device for communication.
RodColeman 0:850eacf3e945 56 *
RodColeman 0:850eacf3e945 57 * @param devnum device number
RodColeman 0:850eacf3e945 58 * @return handle to serial device if successful, NULL otherwise
RodColeman 0:850eacf3e945 59 */
RodColeman 0:850eacf3e945 60 sio_fd_t sio_open(u8_t devnum);
RodColeman 0:850eacf3e945 61 #endif
RodColeman 0:850eacf3e945 62
RodColeman 0:850eacf3e945 63 #ifndef sio_send
RodColeman 0:850eacf3e945 64 /**
RodColeman 0:850eacf3e945 65 * Sends a single character to the serial device.
RodColeman 0:850eacf3e945 66 *
RodColeman 0:850eacf3e945 67 * @param c character to send
RodColeman 0:850eacf3e945 68 * @param fd serial device handle
RodColeman 0:850eacf3e945 69 *
RodColeman 0:850eacf3e945 70 * @note This function will block until the character can be sent.
RodColeman 0:850eacf3e945 71 */
RodColeman 0:850eacf3e945 72 void sio_send(u8_t c, sio_fd_t fd);
RodColeman 0:850eacf3e945 73 #endif
RodColeman 0:850eacf3e945 74
RodColeman 0:850eacf3e945 75 #ifndef sio_recv
RodColeman 0:850eacf3e945 76 /**
RodColeman 0:850eacf3e945 77 * Receives a single character from the serial device.
RodColeman 0:850eacf3e945 78 *
RodColeman 0:850eacf3e945 79 * @param fd serial device handle
RodColeman 0:850eacf3e945 80 *
RodColeman 0:850eacf3e945 81 * @note This function will block until a character is received.
RodColeman 0:850eacf3e945 82 */
RodColeman 0:850eacf3e945 83 u8_t sio_recv(sio_fd_t fd);
RodColeman 0:850eacf3e945 84 #endif
RodColeman 0:850eacf3e945 85
RodColeman 0:850eacf3e945 86 #ifndef sio_read
RodColeman 0:850eacf3e945 87 /**
RodColeman 0:850eacf3e945 88 * Reads from the serial device.
RodColeman 0:850eacf3e945 89 *
RodColeman 0:850eacf3e945 90 * @param fd serial device handle
RodColeman 0:850eacf3e945 91 * @param data pointer to data buffer for receiving
RodColeman 0:850eacf3e945 92 * @param len maximum length (in bytes) of data to receive
RodColeman 0:850eacf3e945 93 * @return number of bytes actually received - may be 0 if aborted by sio_read_abort
RodColeman 0:850eacf3e945 94 *
RodColeman 0:850eacf3e945 95 * @note This function will block until data can be received. The blocking
RodColeman 0:850eacf3e945 96 * can be cancelled by calling sio_read_abort().
RodColeman 0:850eacf3e945 97 */
RodColeman 0:850eacf3e945 98 u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len);
RodColeman 0:850eacf3e945 99 #endif
RodColeman 0:850eacf3e945 100
RodColeman 0:850eacf3e945 101 #ifndef sio_tryread
RodColeman 0:850eacf3e945 102 /**
RodColeman 0:850eacf3e945 103 * Tries to read from the serial device. Same as sio_read but returns
RodColeman 0:850eacf3e945 104 * immediately if no data is available and never blocks.
RodColeman 0:850eacf3e945 105 *
RodColeman 0:850eacf3e945 106 * @param fd serial device handle
RodColeman 0:850eacf3e945 107 * @param data pointer to data buffer for receiving
RodColeman 0:850eacf3e945 108 * @param len maximum length (in bytes) of data to receive
RodColeman 0:850eacf3e945 109 * @return number of bytes actually received
RodColeman 0:850eacf3e945 110 */
RodColeman 0:850eacf3e945 111 u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len);
RodColeman 0:850eacf3e945 112 #endif
RodColeman 0:850eacf3e945 113
RodColeman 0:850eacf3e945 114 #ifndef sio_write
RodColeman 0:850eacf3e945 115 /**
RodColeman 0:850eacf3e945 116 * Writes to the serial device.
RodColeman 0:850eacf3e945 117 *
RodColeman 0:850eacf3e945 118 * @param fd serial device handle
RodColeman 0:850eacf3e945 119 * @param data pointer to data to send
RodColeman 0:850eacf3e945 120 * @param len length (in bytes) of data to send
RodColeman 0:850eacf3e945 121 * @return number of bytes actually sent
RodColeman 0:850eacf3e945 122 *
RodColeman 0:850eacf3e945 123 * @note This function will block until all data can be sent.
RodColeman 0:850eacf3e945 124 */
RodColeman 0:850eacf3e945 125 u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len);
RodColeman 0:850eacf3e945 126 #endif
RodColeman 0:850eacf3e945 127
RodColeman 0:850eacf3e945 128 #ifndef sio_read_abort
RodColeman 0:850eacf3e945 129 /**
RodColeman 0:850eacf3e945 130 * Aborts a blocking sio_read() call.
RodColeman 0:850eacf3e945 131 *
RodColeman 0:850eacf3e945 132 * @param fd serial device handle
RodColeman 0:850eacf3e945 133 */
RodColeman 0:850eacf3e945 134 void sio_read_abort(sio_fd_t fd);
RodColeman 0:850eacf3e945 135 #endif
RodColeman 0:850eacf3e945 136
RodColeman 0:850eacf3e945 137 #ifdef __cplusplus
RodColeman 0:850eacf3e945 138 }
RodColeman 0:850eacf3e945 139 #endif
RodColeman 0:850eacf3e945 140
RodColeman 0:850eacf3e945 141 #endif /* __SIO_H__ */