mbeduino + Weatherduino Weather Stations post test

Dependencies:   mbed

Committer:
okini3939
Date:
Tue Oct 26 17:19:28 2010 +0000
Revision:
0:10bcaa7c2253

        

Who changed what in which revision?

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